﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Login.aspx.cs" Inherits="BIZMA.Login" %>
<%@ Register Assembly="BIZMA" Namespace="BL.BetterControls"  TagPrefix="BC" %>
<!DOCTYPE html>
<!-- paulirish.com/2008/conditional-stylesheets-vs-css-hacks-answer-neither/ -->
<!--[if lt IE 7]>  <html class="no-js ie ie9 lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]>     <html class="no-js ie ie9 lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]>     <html class="no-js ie ie9 lt-ie9"> <![endif]-->
<!--[if IE 9]>     <html class="no-js ie ie9"> <![endif]-->
<!--[if gt IE 9]>  <html class="no-js ie ie9"> <![endif]-->
<!--[if !IE]><!--> <html class="no-js" lang="en"> <!--<![endif]-->
<head id="Head1" runat="server">
    <title></title>
  <meta charset="utf-8" />
  <!-- Set the viewport width to device width for mobile -->
  <meta name="viewport" content="width=device-width" />
  <!-- Included CSS Files (Uncompressed) -->
  <link href="/stylesheets/foundation.css" rel="stylesheet">
  <link href="/stylesheets/modal.css" rel="stylesheet" type="text/css" />
  <link href="/stylesheets/sc_menu.css" rel="stylesheet" type="text/css" /> 
  <link href="/stylesheets/general_foundicons.css" rel="stylesheet">
  <link href="/stylesheets/responsive-tables.css" rel="stylesheet">
  <link href="/stylesheets/app.css" rel="stylesheet">
  <script src="/javascripts/modernizr.foundation.js" type="text/javascript"></script>
</head>
<body>
    <form id="form1" runat="server">
    <div class="rows">
        <div class="six columns centered">
        <h1>Välkommen till BIZMA</h1>
    </div>
        <div class="rows">
        <div class="six columns centered">    
    <asp:Login ID="Login1" runat="server" onloggedin="Login1_LoggedIn">
        <LayoutTemplate>
             <div class="rows">
             <div class="twelve columns"><h5>Log In</h5></div>
             </div>
             <div class="rows">
             <div class="twelve columns"><BC:_Textbox ID="UserName" runat="server" Description="Användarnamn" LabelClass=""></BC:_Textbox>    
                     <BC:_RequiredFieldValidator ID="UserNameRequired" runat="server" 
                                        ControlToValidate="UserName" ErrorMessage="User Name is required." 
                                        ToolTip="User Name is required." ValidationGroup="Login1"></BC:_RequiredFieldValidator></div>
             </div>
             <div class="rows">
             <div class="twelve columns"><BC:_TextBox ID="Password" runat="server"  Description="Lösenord" TextMode="Password"></BC:_TextBox>
                                    <BC:_RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                        ControlToValidate="Password" ErrorMessage="Password is required." 
                                        ToolTip="Password is required." ValidationGroup="Login1"></BC:_RequiredFieldValidator></div>
             </div>
                          <div class="rows">
             <div class="twelve columns">
                 <BC:_CheckBox ID="RememberMe" runat="server" Description="Spara inloggning" DivStyle="" DivType="" LabelClass="" />
             </div>
             </div>
             
             <div class="rows" >
             <div class="twelve columns" style="color:Red;">
                    <asp:Literal ID="FailureText" runat="server" EnableViewState="False"></asp:Literal>
             </div>
             </div>
                                                    <div class="rows">
             <div class="twelve columns">
                 <BC:_Button ID="LoginButton" runat="server" CommandName="Login" Description="Logga in" ValidationGroup="Login1" DivStyle="" DivType="none"
                     ZurbType="positive" />
             </div>
             </div>
             
        </LayoutTemplate>
    </asp:Login>
    </div>  
    </div>
   </form>

  <!-- Footer -->
  <footer class="row">
    <div class="twelve columns">
      <hr />
      <div class="row">
        <div class="six columns">
          <p>&copy; Copyright Sigma 2012. BIZMA&reg is a registered trademark of Sigma</p>
        </div>
        <div class="six columns">
 <%--         <ul class="link-list right">
            <li><a href="#">Link 1</a></li>
            <li><a href="#">Link 2</a></li>
            <li><a href="#">Link 3</a></li>
            <li><a href="#">Link 4</a></li>
          </ul>--%>
        </div>
      </div>
    </div>
  </footer>
  <!-- End Footer -->
   <script src="/javascripts/jquery.js" type="text/javascript"></script>
   <script src="/javascripts/foundation.min.js" type="text/javascript"></script>
   <script src="/javascripts/app.js" type="text/javascript"></script>
   <script src="/javascripts/responsive-tables.js" type="text/javascript" ></script>
   <script language="javascript" type="text/javascript">
       /**
       * Re-assigns the ASP.NET validation JS function to
       * provide a more flexible approach
       */
       function UpgradeASPNETValidation() {
           if (typeof (Page_ClientValidate) != "undefined") {
               AspValidatorUpdateDisplay = ValidatorUpdateDisplay;
               ValidatorUpdateDisplay = NicerValidatorUpdateDisplay;
               AspValidatorValidate = ValidatorValidate;
               ValidatorValidate = NicerValidatorValidate;
           }
       }

       /**
       * This function is called once for each Field Validator, passing in the 
       * Field Validator span, which has helpful properties 'isvalid' (bool) and
       * 'controltovalidate' (string = id of the input field to validate).
       */
       function NicerValidatorUpdateDisplay(val) {
           // Do the default asp.net display of validation errors (remove if you want)
           //AspValidatorUpdateDisplay(val);

           // Add our custom display of validation errors
           // IF we should be paying any attention to this validator at all
           if ((typeof (val.enabled) == "undefined" || val.enabled != false) && IsValidationGroupMatch(val, AspValidatorValidating)) {
               if (val.isvalid) {
                   // reset invalid controls so they display as valid
                   $('#' + val.controltovalidate).removeClass(' error');
                   $('#' + val.controltovalidate + '_label').removeClass(' error');
                   $('#' + val.id).removeClass(' error');
                   $('#' + val.id).addClass(' valid');
                   // $('#' + val.controltovalidate).parents('.control-group:first').removeClass('error');
               } else {
                   // do whatever you want for invalid controls
                   $('#' + val.controltovalidate).addClass(' error');
                   $('#' + val.controltovalidate + '_label').addClass(' error');
                   $('#' + val.id).removeClass(' valid');
                   $('#' + val.id).addClass(' error');

                   //$('#' + val.controltovalidate).parents('.control-group:first').addClass('error');
                   //var t = $('#' + val.controltovalidate).parents('.control-group:first');
                   //t.addClass('error');
               }
           }
       }

       function NicerValidatorValidate(val, validationGroup, event) {
           AspValidatorValidating = validationGroup;
           AspValidatorValidate(val, validationGroup, event);
       }

       // Call UpgradeASPNETValidation after the page has loaded so that it 
       // runs after the standard ASP.NET scripts.
       $(document).ready(UpgradeASPNETValidation);
    
    </script>
</body>
</html>
